


****** Figure 4: Type of Country  ****** 


use "Data_Duties_Master.dta", clear


****** Panel A: Type of Country  ****** 

* Generate the new string variable
gen transform_regime = ""

* Replace based on conditions
replace transform_regime = "1. Communist" if Communist == "1"
replace transform_regime = "2. Socialist" if socialsm == 1 & Communist != "1"
replace transform_regime = "3. All Other" if socialsm != 1 & Communist != "1"

graph bar (mean) duties_total if year ==2017, over(transform_regime) ///
    ytitle("Average Number of Duties")  plotregion(style(none))  bar(1, color(red))	

	
summarize duties_total if 	transform_regime == "1. Communist" & year ==2017
summarize duties_total if 	transform_regime == "2. Socialist" & year ==2017
summarize duties_total if 	transform_regime == "3. All Other" & year ==2017


graph export "Figure_4A.pdf", replace

	
****** Panel B: Income Group  ****** 


replace incomegroup="4. High Income" if incomegroup=="High income"
replace incomegroup="3. Upper Middle Income" if incomegroup=="Upper middle income"
replace incomegroup="2. Lower Middle Income" if incomegroup=="Lower middle income"
replace incomegroup="1. Low Income" if incomegroup=="Low income"

graph bar (mean) duties_total if year ==2017, over(incomegroup) ///
    ytitle("Average Number of Duties")  plotregion(style(none)) 	 bar(1, color(blue))


summarize duties_total if incomegroup=="4. High Income" & year ==2017
summarize duties_total if incomegroup=="3. Upper Middle Income" & year ==2017
summarize duties_total if incomegroup=="2. Lower Middle Income" & year ==2017
summarize duties_total if incomegroup=="1. Low Income" & year ==2017



graph export "Figure_4B.pdf", replace
